//
//  PackageTableViewCell.m
//  Wedding fantastic
//
//  Created by dllo on 15/7/13.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "PackageTableViewCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation PackageTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backView = [[UIView alloc] init];
        self.backView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.backView];
        [_backView release];
        
        self.topImage = [[UIImageView alloc] init];
        [self.backView addSubview:self.topImage];
        [_topImage release];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.font = [UIFont systemFontOfSize:14.5];
        [self.backView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.sellName = [[UILabel alloc] init];
        self.sellName.font = [UIFont systemFontOfSize:13];
        self.sellName.textColor = [UIColor grayColor];
        [self.backView addSubview:self.sellName];
        [_sellName release];
        
        self.priceLabel = [[UILabel alloc] init];
        self.priceLabel.textColor = [UIColor redColor];
        self.priceLabel.font = [UIFont boldSystemFontOfSize:18];
        [self.backView addSubview:self.priceLabel];
        [_priceLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.backView.frame = CGRectMake(10 * WIDTH / 375, 5 * HEIGHT / 280, 355 * WIDTH / 375, 270 * HEIGHT / 280);
    self.topImage.frame = CGRectMake(0, 0, self.backView.frame.size.width, 200 * HEIGHT / 280);
    self.titleLabel.frame = CGRectMake(10 * WIDTH / 375, 205 * HEIGHT / 280, 280 * WIDTH / 375, 30 * HEIGHT / 280);
    self.sellName.frame = CGRectMake(10 * WIDTH / 375, 240 * HEIGHT / 280, 200 * WIDTH / 375, 20 * HEIGHT / 280);
    self.priceLabel.frame = CGRectMake(235 * WIDTH / 375, 225 * HEIGHT / 280, 110 * WIDTH / 375, 40 * HEIGHT / 280);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
